import { IParam, EntityBase } from '@/core';
import { IAuth_member } from './interface/i-auth-member';
import Auth_memberKeys from './auth-member-keys';

/**
 * 隶属信息基类
 * 基于template/src/api/{{appEntities}}/{{appEntities}}-base.ts.hbs生成
 *
 * @export
 * @abstract
 * @class Auth_memberBase
 * @extends { EntityBase }
 * @implements { IAuth_member }
 */
export abstract class Auth_memberBase
	extends EntityBase
	implements IAuth_member
{
	/**
	 * 实体名称
	 *
	 * @readonly
	 * @type {string}
	 * @memberof Auth_memberBase
	 */
	get srfdename(): string {
		return 'AUTH_MEMBER';
	}

	/**
	 * 当前实体所有属性
	 *
	 * @protected
	 * @type {string[]}
	 * @memberof Auth_memberBase
	 */
	protected get keys(): string[] {
		return Auth_memberKeys;
	}

	/**
	 * Creates an instance of ConstactOppoBase.
	 * @param {*} [data]
	 * @memberof Auth_memberBase
	 */
	constructor(data?: any) {
		super();
		this.setData(data);
	}

	get srfkey(): string {
		return this.organizational_role_id;
	}

	set srfkey(val: string) {
		this.organizational_role_id = val;
	}

	/**
	 * 用户组标识
	 **/
	organizational_role_id?: any;

	get srfmajortext(): string {
		return this.organizational_role_name;
	}

	set srfmajortext(val: string) {
		this.organizational_role_name = val;
	}
	/**
	 * 用户组名称
	 **/
	organizational_role_name?: any;

	/**
	 * 部门标识
	 **/
	department_id?: any;

	/**
	 * 部门编号
	 **/
	department_number?: any;

	/**
	 * 部门名称
	 **/
	department_name?: any;

	/**
	 * 组织机构标识
	 **/
	organization_id?: any;

	/**
	 * 机构编号
	 **/
	organization_number?: any;

	/**
	 * 组织机构名称
	 **/
	organization_name?: any;

	/**
	 * DC
	 **/
	dc?: any;

	/**
	 * 重置实体数据
	 *
	 * @param {IParam} [data={}]
	 * @memberof Auth_memberBase
	 */
	reset(data: IParam = {}): void {
		super.reset(data);
		this.organizational_role_id = data.organizational_role_id || data.srfkey;
		this.organizational_role_name =
			data.organizational_role_name || data.srfmajortext;
	}
}
